Getting started: Use <choices> in the schema
authorMatthias Clasen <mclasen@redhat.com>
Tue, 23 Jul 2013 23:20:07 +0000 (19:20 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 24 Jul 2013 11:31:05 +0000 (07:31 -0400)
The use of a manually-specified enum is a little unusual.
This is really meant to be done by <choices>.

examples/application5/org.gtk.exampleapp.gschema.xml
examples/application6/org.gtk.exampleapp.gschema.xml
examples/application7/org.gtk.exampleapp.gschema.xml
examples/application8/org.gtk.exampleapp.gschema.xml

index 89718c480cc3d877d03fecb54646d3593928529e..fc0c2c003d0ffb6f5d43bcff45baa05fb7b5ebad 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
-  <enum id="org.gtk.exampleapp.Transition">
-    <value value="0" nick="none"/>
-    <value value="1" nick="crossfade"/>
-    <value value="6" nick="slide-left-right"/>
-  </enum>
   <schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
     <key name="font" type="s">
       <default>'Monospace 12'</default>
       <summary>Font</summary>
       <description>The font to be used for content.</description>
     </key>
-    <key name="transition" enum="org.gtk.exampleapp.Transition">
+    <key name="transition" type="s">
+      <choices>
+        <choice value='none'/>
+        <choice value='crossfade'/>
+        <choice value='slide-left-right'/>
+      </choices>
       <default>'none'</default>
       <summary>Transition</summary>
       <description>The transition to use when switching tabs.</description>
index 89718c480cc3d877d03fecb54646d3593928529e..fc0c2c003d0ffb6f5d43bcff45baa05fb7b5ebad 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
-  <enum id="org.gtk.exampleapp.Transition">
-    <value value="0" nick="none"/>
-    <value value="1" nick="crossfade"/>
-    <value value="6" nick="slide-left-right"/>
-  </enum>
   <schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
     <key name="font" type="s">
       <default>'Monospace 12'</default>
       <summary>Font</summary>
       <description>The font to be used for content.</description>
     </key>
-    <key name="transition" enum="org.gtk.exampleapp.Transition">
+    <key name="transition" type="s">
+      <choices>
+        <choice value='none'/>
+        <choice value='crossfade'/>
+        <choice value='slide-left-right'/>
+      </choices>
       <default>'none'</default>
       <summary>Transition</summary>
       <description>The transition to use when switching tabs.</description>
index 89718c480cc3d877d03fecb54646d3593928529e..fc0c2c003d0ffb6f5d43bcff45baa05fb7b5ebad 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
-  <enum id="org.gtk.exampleapp.Transition">
-    <value value="0" nick="none"/>
-    <value value="1" nick="crossfade"/>
-    <value value="6" nick="slide-left-right"/>
-  </enum>
   <schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
     <key name="font" type="s">
       <default>'Monospace 12'</default>
       <summary>Font</summary>
       <description>The font to be used for content.</description>
     </key>
-    <key name="transition" enum="org.gtk.exampleapp.Transition">
+    <key name="transition" type="s">
+      <choices>
+        <choice value='none'/>
+        <choice value='crossfade'/>
+        <choice value='slide-left-right'/>
+      </choices>
       <default>'none'</default>
       <summary>Transition</summary>
       <description>The transition to use when switching tabs.</description>
index 218ae80ecf6ca912457e07b1f4156f0c3d9c735d..a6929a859b0587dd56dc0d7419bcdd912f8e5ab3 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <schemalist>
-  <enum id="org.gtk.exampleapp.Transition">
-    <value value="0" nick="none"/>
-    <value value="1" nick="crossfade"/>
-    <value value="6" nick="slide-left-right"/>
-  </enum>
   <schema path="/org/gtk/exampleapp/" id="org.gtk.exampleapp">
     <key name="font" type="s">
       <default>'Monospace 12'</default>
       <summary>Font</summary>
       <description>The font to be used for content.</description>
     </key>
-    <key name="transition" enum="org.gtk.exampleapp.Transition">
+    <key name="transition" type="s">
+      <choices>
+        <choice value='none'/>
+        <choice value='crossfade'/>
+        <choice value='slide-left-right'/>
+      </choices>
       <default>'none'</default>
       <summary>Transition</summary>
       <description>The transition to use when switching tabs.</description>